#ifndef BASE_LOG_H
#define BASE_LOG_H

#include "base_core.h"


//-----------------------------------------------------------------------------
// Logging
//-----------------------------------------------------------------------------


/**
 * \brief Logging levels enumeration.
 */
typedef enum
{
    /// \brief Debugging level.
    LOG_DBG,

    /// \brief Information level.
    LOG_INFO,

    /// \brief Warning level.
    LOG_WARN,

    /// \brief Error level.
    LOG_ERR,

} LogLevel;

/**
 * \brief Log a formatted message.
 * \param lvl Log level for the message
 * \param format printf-style format argument
 */
void log_printf(LogLevel lvl, const char *format, ...);

/**
 * \brief Log a message.
 * \param lvl Log level for the message
 * \param str Message string
 */
void log_puts(LogLevel lvl, const char *str);

/**
 * \brief Set logging level cutoff.
 * Any message with level < cutoff will be ignored.
 * \param lvl New logging level
 */
void log_set_level(LogLevel lvl);

/**
 * \brief Get current logging level cutoff.
 * \return Logging level cutoff.
 */
LogLevel log_get_level(void);

#endif
